package cn.u313.listener;

import cn.u313.comm.utils.MsgUtil;
import cn.u313.comm.utils.Util;
import cn.u313.config.AiConfig;
import cn.u313.repository.UserEntryRepository;
import cn.u313.service.UserEntryService;
import cn.u313.test.Test1;
import com.alibaba.fastjson.JSON;
import lombok.val;
import love.forte.simbot.annotation.Filter;
import love.forte.simbot.annotation.OnGroup;
import love.forte.simbot.api.message.events.GroupMsg;
import love.forte.simbot.api.sender.MsgSender;
import love.forte.simbot.filter.MatchType;
import love.forte.simbot.utils.MD5;
import me.kuku.utils.OkHttpUtils;
import okhttp3.RequestBody;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.nio.charset.StandardCharsets;
import java.util.Base64;
import java.util.HashMap;
import java.util.Map;

/**
 * @ProjectName: bot_220624
 * @Package: cn.u313.listener
 * @ClassName: GptListener
 * @Author: 柳苏言
 * @Description:
 * @Date: 2023/7/29 14:02
 * @Version: 1.0
 */
@Component
public class GptListener extends BaseListen {
    int AiImage = 100;
    @Autowired
    UserEntryService userEntryService;
    String data = "{\n" +
            "    \"model\": \"gpt-3.5-turbo\",\n" +
            "    \"max_tokens\": %s,\n" +
            "    \"messages\": [\n" +
            "      {\n" +
            "        \"role\": \"system\",\n" +
            "        \"content\": \"最多回复100个字符。" +
            "涉政有关的内容，" +
            "和宗教有关的内容，" +
            "和血腥有关的内容，" +
            "和辱国有关的内容，" +
            "和反动有关的内容、" +
            "和邪教有关的内容一律回复：" +
            "“该话题不予回复, 请换个话题谢谢！”\"\n" +
            "      },\n" +
            "      {\n" +
            "        \"role\": \"user\",\n" +
            "        \"content\": \"%S\"\n" +
            "      }\n" +
            "    ]\n" +
            "  }";
    String url = "https://service-4759o874-1258657494.hk.apigw.tencentcs.com/v1/chat/completions";
    Map stringStringHashMap =new HashMap<String, String>();

    {

        stringStringHashMap.put("Content-Type","application/json");
        stringStringHashMap.put("Authorization","Bearer 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");
    }
    @OnGroup
    @Filter(value = "gpt",matchType = MatchType.STARTS_WITH)
    @Filter(value = "GPT",matchType = MatchType.STARTS_WITH)
    @Filter(value = "Gpt",matchType = MatchType.STARTS_WITH)
    @Filter(value = "GPt",matchType = MatchType.STARTS_WITH)
    @Filter(value = "GPt",matchType = MatchType.STARTS_WITH)
    public void gpt(GroupMsg groupMsg, MsgSender msgSender){
        val msg = groupMsg.getMsg();
        val qq = getQQ(groupMsg);
        val user = userEntryService.getUser(qq);
        if (user.getGptToken() < 0) {
            sendMsg(msgSender,groupMsg,"您当前gpt Token额度不足！\n您目前的 Token数量: "+user.getGptToken() +"\n您可以使用悦币兑换Token\n命令：购买Token ");
            return;
        }
        if (msg.length() <5){
            sendMsg(msgSender,groupMsg,"请输入长一点的描述... ");
            return;
        }
        try {
            sendMsg(msgSender,groupMsg,"正在处理中，请稍后... ");
            String q = msg.substring(3);
            val string = OkHttpUtils.post(url, OkHttpUtils.addJson(String.format(data, MsgUtil.maxToken,q)),stringStringHashMap).body().string();

            System.out.println(string);
            val string1 = JSON.parseObject(string).getJSONArray("choices").getJSONObject(0).getJSONObject("message").getString("content");
            val total_tokens = JSON.parseObject(string).getJSONObject("usage").getInteger("completion_tokens");
            user.setGptToken(user.getGptToken() - total_tokens);
            userEntryService.save(user);
            sendMsg(msgSender,groupMsg,"[CAT:at,code="+getQQ(groupMsg)+"] " + "\n\uD83D\uDE0A："+string1 + "\n\n\n[CAT:face,id=176]本次消耗Token: "+total_tokens+"\n[CAT:face,id=319]您的Token剩余: "+user.getGptToken(),false);
            System.out.println(string);
        } catch (IOException e) {
            e.printStackTrace();
            sendMsg(msgSender,groupMsg,"生成失败！> "+e.getMessage());
        }
    }

    @OnGroup
    @Filter(value = "作画",matchType = MatchType.STARTS_WITH)
    @Filter(value = "画画",matchType = MatchType.STARTS_WITH)
    @Filter(value = "做画",matchType = MatchType.STARTS_WITH)
    @Filter(value = "画个",matchType = MatchType.STARTS_WITH)
    public void aiImg(GroupMsg groupMsg, MsgSender msgSender){
        val msg = groupMsg.getMsg();
        if (msg.contains("胸")||msg.contains("奶")||msg.contains("裸") || msg.contains("乳")|| msg.contains("涩")) {
            sendMsg(msgSender,groupMsg,"触发违禁词，多次触发将被小嘤拉黑");
            return;
        }
        if (msg.length() <5){
            sendMsg(msgSender,groupMsg,"请输入长一点的描述... ");
            return;
        }
        val qq = getQQ(groupMsg);
        val user = userEntryService.getUser(qq);
        if (!user.payToken(-AiImage)){
            sendMsg(msgSender,groupMsg,"您的Ai Token 数量不足！");
            return ;
        }

        try {
            sendMsg(msgSender,groupMsg,"正在生成中... ");
            String appid = "20230711001740700";
            String q = msg.substring(2).replace("\n","");
            String salt = System.currentTimeMillis() + "";
            String key = "PShUm8_aI9dcBZ_xoAcr";


            String api = "http://api.fanyi.baidu.com/api/trans/vip/translate" +
                    "?q=" + q + "" +
                    "&from=auto" +
                    "&to=en" +
                    "&appid=" + appid +
                    "&salt=" + salt +
                    "&sign=" + MD5.INSTANCE.get(appid + q + salt + key);
            val json = OkHttpUtils.get(api).body().string();
            System.out.println(json);
//            System.out.println(MD5.INSTANCE.get("2015063000000001apple143566028812345678"));
//            System.out.println(appid + q + salt + key);

            val txt = JSON.parseObject(json).getJSONArray("trans_result").getJSONObject(0).getString("dst");
            System.out.println(txt);

            val map = new HashMap<String,String>();
            map.put("enable_openai","0");
            map.put("steps","20");
            map.put("width","512");
            map.put("height","512");
            map.put("batch_count","1");
            map.put("styles","");

            map.put("prompt",txt);
            val string = OkHttpUtils.post("https://passport-api.topmediai.com/v1/txt2img", map).body().string();
//
            System.out.println(string);

            String url = Util.getSubUtil1(string,"https(.*?)png") ;
//            System.out.println();
            val s = Test1.saveImg("https" + url + "png");
            userEntryService.save(user);
            sendMsg(msgSender,groupMsg,"[CAT:at,code="+qq+"] " + "你的画作已生成！"+getImgCAT(s) +"\n\n本次作画消耗Token: "+AiImage +"\n您的Token剩余: "+ user.getGptToken());
        } catch (Exception e) {
//            throw new RuntimeException(e);
            sendMsg(msgSender,groupMsg,"生成失败！> xxx");
        }
    }
    @OnGroup
    @Filter(value = "购买Token",matchType = MatchType.STARTS_WITH)
    @Filter(value = "购买token",matchType = MatchType.STARTS_WITH)
    @Filter(value = "购买gpt",matchType = MatchType.STARTS_WITH)
    @Filter(value = "购买ai",matchType = MatchType.STARTS_WITH)
    @Filter(value = "购买Ai",matchType = MatchType.STARTS_WITH)
    @Filter(value = "购买AI",matchType = MatchType.STARTS_WITH)
    @Filter(value = "购买作画",matchType = MatchType.STARTS_WITH)
    @Filter(value = "购买GPT",matchType = MatchType.STARTS_WITH)
    public void buyToken(GroupMsg groupMsg, MsgSender msgSender){
        val code = getCode(groupMsg);
        int token = 0;
        int yb = 0;
        if (code == null) {
            sendMsg(msgSender,groupMsg,
                    "购买AI Token\n" +
                    "【1】100 悦币兑换1K Token\n" +
                    "【2】500 悦币兑换6K Token\n" +
                    "【3】800 悦币兑换10K Token\n" +
                    "【4】1K  悦币兑换15K Token\n" +
                    "\n" +
                    "回复：购买Token【序号】",false);
            return ;
        }else if(code.equals("1")){
            token = 1000;
            yb = 100;
        }else if(code.equals("2")){
            token = 6000;
            yb = 500;
        }else if(code.equals("3")){
            token = 10000;
            yb = 800;
        }else if(code.equals("4")){
            token = 15000;
            yb = 1000;
        }else {
            sendMsg(msgSender,groupMsg,
                    "购买AI Token\n" +
                            "【1】100 悦币兑换1K Token\n" +
                            "【2】500 悦币兑换6K Token\n" +
                            "【3】800 悦币兑换10K Token\n" +
                            "【4】1K  悦币兑换15K Token\n" +
                            "\n" +
                            "回复：购买Token【序号】",false);
            return;
        }
        val qq = getQQ(groupMsg);
        val user = userEntryService.getUser(qq);
        if (user.payMe(-yb)) {
            user.setGptToken(token + user.getGptToken());
            userEntryService.save(user);
            sendMsg(msgSender,groupMsg,
                    "购买成功！\n"+"悦币数量："+user.getM()+"\n红包余额："+user.getHongBao()+ "\nAi Token："+user.getGptToken());
        }else {
            sendMsg(msgSender,groupMsg,
                    "悦币不足哦！");
        }
    }


    @OnGroup
    @Filter(value = "高级作画",matchType = MatchType.STARTS_WITH)
    public void aiImgPlus(GroupMsg groupMsg, MsgSender msgSender){
        try {
            if (!isManager(groupMsg)) {
                sendMsg(msgSender,groupMsg,"无操作权限！");
                return;
            }
//            appid+q+salt+密钥的MD5值
            sendMsg(msgSender,groupMsg,"图片生成中，请耐心等待1-10分钟... ");
            String appid = "20230711001740700";
//            String q = "(Realistic painting style:1.0), (faux traditional media:1.0), masterpiece, best quality, soft lighting, absurdres, looking at viewer, solo, ponytail, serafuku, kamisato ayaka (heytea), official alternate costume, kamisato ayaka, blunt bangs, hair bow, hair ribbon, red ribbon, school uniform, sailor shirt, sailor collar, pleated skirt, 1girl, skirt, black bow, cate, coffee, light blue hair. grey eyes, coffee cup";

            String q = groupMsg.getMsg().replace("高级作画","");
            String salt = System.currentTimeMillis() + "";
            String key = "PShUm8_aI9dcBZ_xoAcr";

            val qq = getQQ(groupMsg);

            String api = "http://api.fanyi.baidu.com/api/trans/vip/translate" +
                    "?q=" + q + "" +
                    "&from=auto" +
                    "&to=en" +
                    "&appid=" + appid +
                    "&salt=" + salt +
                    "&sign=" + MD5.INSTANCE.get(appid + q + salt + key);
            val json = OkHttpUtils.get(api).body().string();
            System.out.println(json);
//            System.out.println(MD5.INSTANCE.get("2015063000000001apple143566028812345678"));
//            System.out.println(appid + q + salt + key);

            val txt = JSON.parseObject(json).getJSONArray("trans_result").getJSONObject(0).getString("dst");
            System.out.println(txt);

            val s = AiConfig.buildConfig(txt, 20, 720, 1080);
            val string = OkHttpUtils.post("http://127.0.0.1:7860/sdapi/v1/txt2img",
                    RequestBody.create(s.getBytes(StandardCharsets.UTF_8))).body().string();
//
//            String string = "{\"images\":[\"iVBORw0KGgoAAAANSUhEUgAAAGAAAABgCAIAAABt+uBvAAAA83RFWHRwYXJhbWV0ZXJzAE5lZ2F0aXZlIHByb21wdDogc3RyaW5nClN0ZXB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+1//9rwx9P3HvU2v8j/7Oj96+vvrm649vv5g/flhN+b/+b19/+NXDsurufn39ye4Hv3f7z//Z18fW/uTnf/HZT27vfvP07VePf/bzh1dvr54/LH/287vrTw7f/OLhZ7+4+9FP39y+Of4P/+QvfvTjT1rj80O8ejvvr6Y/+WffvH4zH66nhw8rTPsrv73d339zfvXp7tMv9uc1dVrXNV+9nem2nnE42Lpk2xEEA9Ysu8qK1AXAjAJopgxWigHplpk0QKTB3DKBAJiQZXYn2kiSgJnRRi7oXSQgrOfw7tPZvHF/nO8+nvfH3X/1T/70P/3P/h6fz//8j3/zT//HX/ztv/Pjye31pwfNvHqz//N//e7du6fluV+99fNdnu7z4e55PpofXMzn5Xz/9bM59sf2cH96/83p1189xJqRIvntu8ee+foTm3ZcI2ZNS+/P98vu6ubbd4+nu1xTz6vu3j81WArffntue3v80G9upx467N0a5nm6etNizbZ3hegFHKjCeCTLOYlMQQWRJEFJpJEyd9JscpgaBW+eEgYfIA3KgleKjB//9PrvTz/83//F1zu3T6+n15/ePH07/+n/9PP3X7//8ge3v/+Hnxe67D3lONxON6/mH/7Bm1//4kO7tk9urp7vnm2y2zd7200fv36U9MmPDp/8zqvffPX+6tXu6pP94y8/fP7jm86+nv14Nd18sXv/9ePhqtnO7u9PN2/2096v3h7uv3ne3eQnP715/9X960+vImK+mtFzfzUrTrtrnzqeHpY3XxyfPq59idbs4ETSJkMXNtytWi0WIC7uogJRtQBmBii6EPBJZuaDJ4kQB2UqYmqA8f7+9OMf7PYNv/zZ+0/28/LxWYHZ/fq4e/3F8XBs17f7P/i7P55bu9rtuMbNcbp9tWeydZ+A6yv/t/7mF+spb497J374o08PV7M74mzoaM32066f83h1fH1zmGa+/Z3X8zQrONu0a+3quJvo57vzjnOcchavjztLEHx1fejnnGi72V69Ody+mT/9wdXrz47Hm3bzdn98PXuzcTtGc8PAbyQByZzmMCuYDUik2mzWQC9cThVeJ2kF3Y0bjieKYkJsOLT1977Yvbmd922+//UTuj794samRuXypJ//6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aQ3SNoQuIpLeWGSCidwjm3n7wh78fSiDtIt1spKsGzUrLLGPNMUHCVavQ/82/+Nl6XnRKS334+uPuabdEGuycftztXr05mDGWBBhLjz5E0spY1mw8Kw6KgLGABfjgQ2ZLYuyONS6CXs+sNBtl1m8ta/zGaIjanMdovnWr5EaPE2Z22E+Tt/W8mlW9w8ur5v2BVrVtVybNWmZarfKYq9z+Aob2NrIuLlmWoMlS8+u3n5rRfT7eTofbGzSAPJ9zbJ+dNvvUPb1Zu/LqqII0hgBSHOyRFxhUSEeV48tyOc64YdctDg2IXjY4ukpKI6g9r/i9Yw6RrvpMpQTy4f3HjGWoT+RyPrNNNKsgZj5WjdHVl07T8NgNwg4u/oL6COiiVFTE7n1dlz4f5lhTmW1ySDU7lpGtNkQf4i0zxr6gA2MVMRn9lPXCb8tsv/3reO0Fa49Xx+KNX4sov2DL7+DyQViU5lyeTxHnWJfo3Yx9XQi/evVZm2ZwbOTK/UxJvaN2RNNY7E2AxYZBt1NsXVj1HwVJ1a4oqukSGQ2Qjf6QarYeQ8TjlJeF2fJj/a7v3vBGMLYTbsvyYgu8/PO9LwEvfO1lPQfmAi6UVgIz6z+ys2RfoRg9vT7tDleqLsIINM3T/H8COodS1t3phWMAAAAASUVORK5CYII=\"],\"parameters\":{\"enable_hr\":false,\"denoising_strength\":0.0,\"firstphase_width\":0,\"firstphase_height\":0,\"hr_scale\":2.0,\"hr_upscaler\":\"string\",\"hr_second_pass_steps\":0,\"hr_resize_x\":0,\"hr_resize_y\":0,\"prompt\":\"\",\"styles\":[\"I like you, sun, w pure, sexy\"],\"seed\":-1,\"subseed\":-1,\"subseed_strength\":0.0,\"seed_resize_from_h\":-1,\"seed_resize_from_w\":-1,\"sampler_name\":\"\",\"batch_size\":1,\"n_iter\":1,\"steps\":5,\"cfg_scale\":7.0,\"width\":100,\"height\":100,\"restore_faces\":false,\"tiling\":false,\"do_not_save_samples\":false,\"do_not_save_grid\":false,\"negative_prompt\":\"string\",\"eta\":0.0,\"s_churn\":0.0,\"s_tmax\":0.0,\"s_tmin\":0.0,\"s_noise\":1.0,\"override_settings\":{},\"override_settings_restore_afterwards\":true,\"script_args\":[],\"sampler_index\":\"Euler\",\"script_name\":\"\",\"send_images\":true,\"save_images\":false,\"alwayson_scripts\":{}},\"info\":\"{\\\"prompt\\\": \\\"\\\", \\\"all_prompts\\\": [\\\"\\\"], \\\"negative_prompt\\\": \\\"string\\\", \\\"all_negative_prompts\\\": [\\\"string\\\"], \\\"seed\\\": 2011389820, \\\"all_seeds\\\": [2011389820], \\\"subseed\\\": 209135955, \\\"all_subseeds\\\": [209135955], \\\"subseed_strength\\\": 0.0, \\\"width\\\": 100, \\\"height\\\": 100, \\\"sampler_name\\\": \\\"Euler\\\", \\\"cfg_scale\\\": 7.0, \\\"steps\\\": 5, \\\"batch_size\\\": 1, \\\"restore_faces\\\": false, \\\"face_restoration_model\\\": null, \\\"sd_model_hash\\\": \\\"8fcb175948\\\", \\\"seed_resize_from_w\\\": -1, \\\"seed_resize_from_h\\\": -1, \\\"denoising_strength\\\": 0.0, \\\"extra_generation_params\\\": {}, \\\"index_of_first_image\\\": 0, \\\"infotexts\\\": [\\\"Negative prompt: string\\\\nSteps: 5, Sampler: Euler, CFG scale: 7.0, Seed: 2011389820, Size: 100x100, Model hash: 8fcb175948, Model: powercolorV1_powercolorV1, Seed resize from: -1x-1, Denoising strength: 0.0, Clip skip: 2, ENSD: 31337\\\"], \\\"styles\\\": [\\\"I like you, sun, w pure, sexy\\\"], \\\"job_timestamp\\\": \\\"20230813140346\\\", \\\"clip_skip\\\": 2, \\\"is_using_inpainting_conditioning\\\": false}\"}";
            System.out.println(string);
            val images = JSON.parseObject(string).getJSONArray("images").getString(0);
//            String url = Util.getSubUtil1(string,"https(.*?)png") ;
////            System.out.println();
//            saveImg("https"+ url + "png");
            // 解密
            // 图片分类路径+图片名+图片后缀
            String imgClassPath = "H:\\git\\chaoxing\\"+System.currentTimeMillis()+".png";
            // 解密
            Base64.Decoder decoder = Base64.getDecoder();
            // 去掉base64前缀 data:image/jpeg;base64,
            byte[] b = decoder.decode(images);
            // 处理数据
            for (int i = 0; i < b.length; ++i) {
                if (b[i] < 0) {
                    b[i] += 256;
                }
            }
            // 保存图片
            OutputStream out = new FileOutputStream(imgClassPath);
            out.write(b);
            out.flush();
            out.close();
            sendMsg(msgSender,groupMsg,"[CAT:at,code="+qq+"] " + "你的画作已生成！"+getImgCAT(s) );

        } catch (Exception e) {
            sendMsg(msgSender,groupMsg,"图片生成失败："+e.getMessage());
            throw new RuntimeException(e);
        }
    }
}
